package com.ybkj.o2o.zhuanxian.manager;

import com.ybkj.o2o.zhuanxian.common.CompanyOrderVo;
import com.ybkj.o2o.zhuanxian.common.DataGrid;
import com.ybkj.o2o.zhuanxian.common.DriverOrderDetailVo;
import com.ybkj.o2o.zhuanxian.common.DriverOrderVo;
import com.ybkj.o2o.zhuanxian.common.MemberOrderVo;
import com.ybkj.o2o.zhuanxian.common.OrderFromSourceVo;
import com.ybkj.o2o.zhuanxian.common.PageVo;
import com.ybkj.o2o.zhuanxian.common.chart.ChartDay;
import com.ybkj.o2o.zhuanxian.common.chart.ChartMonth;
import com.ybkj.o2o.zhuanxian.common.chart.ChartYear;
import com.ybkj.o2o.zhuanxian.common.error.Error;
import com.ybkj.o2o.zhuanxian.entity.Car;
import com.ybkj.o2o.zhuanxian.entity.Order;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface OrderManager {
  void insertCycleRecord(Map<String,Object> map) ;

  List<Map<String,Object>> redPacketCycle(Date orderDate, String cycle);

  List<Order> cycleOrder(Date startDate, Date endDate);

  Order insert(Integer orderType, Long lineId, String lineName, Long companyId, String companyName,
      Long passengerId, String passengerName, String passengerPhone, String channelName,
      String startAddress, Double startLat, Double startLng, String endAddress, Double endLat,
      Double endLng, Date serverDate, Integer serverDeadTime, Double prestartPrice,
      Double premileagePrice, Double prerunTimePrice, Double budgetPay, Long couponId,
      Integer pretravelTime, Double premileage, Long peopleNumber, String operator, String memo,
      String takeDeliveryName, String takeDeliveryPhone, String showPhone, String showName,
      String appKey, Boolean system);

  Order findByIdAndAppKey(Long orderId, String appKey);

  void baoxiao(Long orderId, Double baoxiaoMoney, String appKey);

  List<Order> findOrderByEmployId(Long employId, Double money, String appKey, Long startTime,
      Long endTime);

  Error run(Long orderId, String operator, String appKey);

  int update(Order order);

  Error wait(Long orderId, String operator, String appKey);

  Error refuse(Long orderId, Long employId, String cause, String operator, String appKey);

  Error jiedan(Long orderId, String appKey);

  DataGrid<Order> findByParam(Long startTime, Long endTime, Long companyId, String companyName,
      String orderNo, Long passengerId, String passengerName, String passengerPhone, Long employId,
      String employName, String employPhone, String carNumber, String status, String orderby,
      String allorderType, Integer page, Integer rows, Boolean treatment, Long startFinishTime,
      Long endFinishTime, Long lineId, String appKey, Long[] linesId);

  void paidan(Order order, Car car, Long employId, String employName, String employPhone,
      Long employCompanyId, String employNo, String employPhoto, Double employScore,
      String operator, String operatorMemo, String appKey);

  Long countFinishByPassenger(Long passengerId, Date start, Date end, String appKey,
      String orderFromSources);

  Order addmore(Integer orderType, Long passengerId, String passengerName, String passengerPhone,
      Long companyId, String companyName, String channelName, String startAddress, Double startLat,
      Double startLng, String endAddress, Double endLat, Double endLng, Date serverDate,
      Integer serverDeadTime, Long employId, String employName, String employPhone,
      Long employCompanyId, String employNo, String employPhoto, Double employScore,
      Long peopleNumber, String memo, Double budgetPay, String takeDeliveryName,
      String takeDeliveryPhone, String appKey);

  int callback(Long orderId, String operator, String cause, String appKey);

  int employCancel(Long orderId, Long employId, String employName, String employPhone,
      Long employCompanyId, String employNo, String employPhoto, Double employScore, String cause,
      String appKey);

  int passengerCancel(Long orderId, Long passengerId, String passengerName, String passengerPhone,
      String cause, String appKey);

  Order complete(Long orderId, Double realPay, Double guoluMoney, Double yuanchengMoney,
      Double otherMoney, Double startPrice, Double mileagePrice, Double runTimePrice,
      Integer waitTime, Double waitPrice, String endAddress, Double endLat, Double endLng,
      Double mileage, Integer runTime, Double couponMoney, String appKey, String prePayTypeDetail,
      String memo,Double justKilometres,BigDecimal justMoney);

  Order findLastOrder(Long passengerId, String appKey);

  Order finishTask(Long orderId, String afterPayTypeDetail, Double companyProfit,
      Double employProfit, Double signMoney, Double balanceMoney, Double alipayMoney,
      Double weixinMoney, Double unionpayMoney, Double cashMoney, String appKey);

  ChartYear dataForYear(Integer year, Long companyId, String appKey);

  ChartDay dataForDay(Integer year, Integer month, Integer day, Long companyId, String appKey);

  Order findFinishedByDriverWithDate(Long employId, Date start, Date end, String appKey);

  List<Order> findMonthOrder(Integer year, Integer month, String appKey);

  ChartMonth dataForMonth(Integer year, Long companyId, Integer month, String appKey);

  PageVo<MemberOrderVo> findMemberOrder(Date startTime, Date endTime,
      Long companyId, String appKey);

  PageVo<OrderFromSourceVo> orderFromSource(Date date1, Date date2, Long companyId, String appKey);

  PageVo<DriverOrderVo> driverAchievement(Date date1, Date date2, Long empCompanyId, String appKey);

  PageVo<CompanyOrderVo> companyOrder(Date date1, Date date2, String appKey);

  PageVo<DriverOrderDetailVo> driverOrderDetailVo(Long driverId, Date start, Date end,
      Integer page, Integer rows, String appKey);

  Map<String, Object> chart(Long companyId, Date startTime, Date endTime, Boolean maincompany,
      Long lineId, String appKey);

  void updateRealMoney(Long orderId, Double couponMoney, Double cashMoney, Double signMoney,
      Double balanceMoney, Double alipayMoney, Double weixinMoney, String operator, String content,
      String appKey);

  DataGrid<Order> queryFinishOrderByEmployId(Long employId, Long start, Long end, Integer page,
      Integer rows, String appKey);

  Long countByPassengerId(Long passengerId, String appKey);

  Long countRunning(Long passengerId, String appKey);

  Long countSeats(Long employId, String appKey);

  List<Order> findNewOrder(Long companyId, String appKey);

  List<Order> findActivedOrder(Long employId, String appKey);

  void cancelOrder(Long orderId, String operator, String cause, String appKey);

  List<Order> findRunOrderByEmployId(Long employId, Boolean treatment, String appKey);

  Long queryRunOrder(Long passengerId, String appKey);

  List<Order> findHastenOrderAppKey(String appKey);

  Order grab(Long orderId, Long employId, String employName, String employPhone, String employNo,
      Double employScore, String employPhoto, Long employCompanyId, String appKey);

  boolean isReceiveAnOrder(Integer orderType, Long employId, Long peopleNumber, String appKey);

  List<Order> findUnexecutedByEmployId(Long employId, String appKey);

  DataGrid<Order> findOrderByPassenger(Long passengerId, Integer page, Integer rows, String appKey);

  List<Order> findByWork(Long employId, String appKey, String status);

  List<Order> findRunOrderByLineId(Long lineId, String appKey);

  List<Order> findRunOrderByCarId(Long carId, String appKey);

  List<Order> findJiedanOrderByEmployId(Long employId, String appKey);

  Long jiedanCountSeats(Long employId, String appKey);


  Boolean prepare(Long orderId, String appKey);

  Long driverOrderDetailCount(Long employId, Date startDate, Date endDate, String appKey);

  int  updateAnonymousNumber(Long orderId, String anonymousNumber, String appKey);
}
